UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fVFwIxCOaQMlID4tJCJjD7yVEFQvVpeAjP2CjEP8qAg='
WHERE
key_id = '1527ecc15049ac25f56632f703678296d5f9e0f07f2c432814b9574edd697d9e'
AND (
token = 'fVFwIxCOaQMlID4tJCJjD7yVEFQvVpeAjP2CjEP8qAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)