UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zGUFEH4odkwZs1wf3lQZkC9j28LyHQ8NMpxLSn9WBuY='
WHERE
key_id = '862fc978a213fc4fd2ae8d39e7d0ee59af2639ebfaf6e57c2a6d29ade9957dd6'
AND (
token = 'zGUFEH4odkwZs1wf3lQZkC9j28LyHQ8NMpxLSn9WBuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)