UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cYoSGoOlVY0uof067GkUIAC67lTJek7F7sl4gSkazIE='
WHERE
key_id = '0d927a2e55fa7e3306b07882019cf8fff8bc959dac473d439fb4251ed16c1215'
AND (
token = 'cYoSGoOlVY0uof067GkUIAC67lTJek7F7sl4gSkazIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)