UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HO9hYVBD43b99NeQCRpegzH8cev02vo2dWuJK6Z7Ls='
WHERE
key_id = 'fba46f292dcd2dbc1fdebb2c255e13719b4d1eb4ed53a9258d900bcef0de6101'
AND (
token = '7HO9hYVBD43b99NeQCRpegzH8cev02vo2dWuJK6Z7Ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)