UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArTKmag8tqry8os8zP4yiAkxLYBDCVBkb/Vwdmdp3SQ='
WHERE
key_id = 'be0805305a9487160c26a91e855544799d40c749a959bafe24264a50cc5b8228'
AND (
token = 'ArTKmag8tqry8os8zP4yiAkxLYBDCVBkb/Vwdmdp3SQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)