UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ea62BvQOl7gPL4NCXprpyPsEnhfalDtalVfuNRTVfmk='
WHERE
key_id = '1243daa124fe0010f974aea50f313519bdcbcb5d7d8ff5593d0bf8e236e75b9f'
AND (
token = 'Ea62BvQOl7gPL4NCXprpyPsEnhfalDtalVfuNRTVfmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)