UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IrbUoLYTRyvPwp98S+CsOkZEx5TthxpNYl5BgQSgB5k='
WHERE
key_id = '6628c476d9815bd4bfcad1e97239c834a4e3adc73daaeeae5404132888ae7619'
AND (
token = 'IrbUoLYTRyvPwp98S+CsOkZEx5TthxpNYl5BgQSgB5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)