UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zSyoiIRKmAVokfEG09iFjVv9RtHHCzLn+Ydfxpcf7VU='
WHERE
key_id = '1172f7c1ce7a5b56dbaec7fe33033166a6550a1f3d77694b6c0264866ee6fd8a'
AND (
token = 'zSyoiIRKmAVokfEG09iFjVv9RtHHCzLn+Ydfxpcf7VU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)