UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7QamiQ4+4DI4UBPl9I1WK4h5NEPdqD5kSPq9jCcgj+s='
WHERE
key_id = '95341e4c01e97f1120783eceedcf4cf1c778dc88155e9a73156c770e300a8e2c'
AND (
token = '7QamiQ4+4DI4UBPl9I1WK4h5NEPdqD5kSPq9jCcgj+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)