UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nI4BCXvTbsHpkFG4n/2WLdLiGFuQDWjjrQzotziidp8='
WHERE
key_id = '13b9e595f61fcb84698a1a1d86619ce92cff56c1319114aba170d4fa307201ac'
AND (
token = 'nI4BCXvTbsHpkFG4n/2WLdLiGFuQDWjjrQzotziidp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)