UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nRpzv9LuOD3cByQGeRpSibwnl3w1LTov8WFmXJW/GFE='
WHERE
key_id = 'b11ce1b3315c9d4f7238a31e3a2332c0dde4cb9a8c2870fe3c4383591edf433a'
AND (
token = 'nRpzv9LuOD3cByQGeRpSibwnl3w1LTov8WFmXJW/GFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)