UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zaHHRZ1mVzPn17GhwzHki/lWqaDj6x1JLFANysuttPc='
WHERE
key_id = '6ad34db0a6a7092aa10e2e2c5d2e8aa4c5a7268529c5e34d75f74474b752f066'
AND (
token = 'zaHHRZ1mVzPn17GhwzHki/lWqaDj6x1JLFANysuttPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)