UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2HqraE4+GaLaVeGaRxN7/TeimgaQaSOls2MxQ5KTJpY='
WHERE
key_id = '6af3da87b4d288b48f75e32f180f4236c4d5374b9aeff5f9f0b0be62eaeabe2b'
AND (
token = '2HqraE4+GaLaVeGaRxN7/TeimgaQaSOls2MxQ5KTJpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)