UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R4lJdZcPx6f/5xWH/GfKoshbKVDSbioC1vlVIcFi8HA='
WHERE
key_id = 'b2f8b8459602b99bd67d87eb13e8681b2ef261c4a9aa9a8b739fe6194980aaa2'
AND (
token = 'R4lJdZcPx6f/5xWH/GfKoshbKVDSbioC1vlVIcFi8HA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)