UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZZBT8xDz/hE7rJ42S4OXBu4/dgyd5W2Xun8L7hvyD8U='
WHERE
key_id = '00605a135fe828e0041ee2a7c189834e49bbe43ccc3e3e2831219140b7529a3a'
AND (
token = 'ZZBT8xDz/hE7rJ42S4OXBu4/dgyd5W2Xun8L7hvyD8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)