UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ST5BeWYOFcbv0jyqlddMYgn7gEyPQcJja1joHgBBYE='
WHERE
key_id = '47eff7733590ff35db0e95a4a841c61167117c2ca6f6791689af62dae6d5d47c'
AND (
token = '4ST5BeWYOFcbv0jyqlddMYgn7gEyPQcJja1joHgBBYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)