UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kwg38aufgPOtwvuP8z2ejW8/uK+9R77tq2SdIaAu/Dg='
WHERE
key_id = 'dc2f328e40bfb7bb2447b2ca7ed64168b7825f8bacfc436cb0e707a53ca1e53b'
AND (
token = 'kwg38aufgPOtwvuP8z2ejW8/uK+9R77tq2SdIaAu/Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)