UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EoXe0RRRsEkeTj/3sdw2VQNjTpmWqRBU16/kRJLo0EU='
WHERE
key_id = '773ada4600f8dd3e2bc068d279b31d61567b259affc06c9b0830ed21dab20c6a'
AND (
token = 'EoXe0RRRsEkeTj/3sdw2VQNjTpmWqRBU16/kRJLo0EU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)