UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kNLHtZm2HOt0aHbsO2S9zeIpWCYJz9Dg8NuFI0Zvlw='
WHERE
key_id = 'e1677d355f65611ae91dd064efd29b62aa6bb1d308ddf1f5ea84e00ffdf88f7e'
AND (
token = '1kNLHtZm2HOt0aHbsO2S9zeIpWCYJz9Dg8NuFI0Zvlw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)