UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOgfvj4R86v2SOcRzAo2liqQ1J4+CVMDoEIev1AN76c='
WHERE
key_id = '1b5c34c7b95ab9a0aaa69a9597b6127675d4a0aa9d1bc8a008e74651e996fa69'
AND (
token = 'yOgfvj4R86v2SOcRzAo2liqQ1J4+CVMDoEIev1AN76c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)