UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HtTfDIn3j/6HtiuddrBgvBH2ddry6OSaYRrisGYgh/0='
WHERE
key_id = '6b63232ef2d56e5a9f28282a833264d388b5dfaeb4027247a1b1b221144561cd'
AND (
token = 'HtTfDIn3j/6HtiuddrBgvBH2ddry6OSaYRrisGYgh/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)