UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3o73Ej0kRCYPqgM9khZmH63Lmk++mjlKR2bLOJ7ihI8='
WHERE
key_id = '1d1ccd547d8e8e4220cffd21309a221a22a772d1b517a20d917ddeb7dc7d108e'
AND (
token = '3o73Ej0kRCYPqgM9khZmH63Lmk++mjlKR2bLOJ7ihI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)