UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5S74hyJ4LkreiCt+ojyGUCemkFAJRzz5zKCG55h0gg='
WHERE
key_id = '07101ef0c7f685721ea0d28e12fde50790f66280a6f9c5fc56d61ee2de78554c'
AND (
token = 't5S74hyJ4LkreiCt+ojyGUCemkFAJRzz5zKCG55h0gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)