UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M5NaHwu/pLM8oImVAd11dAVHBPQuPGLoGgukUru/tqc='
WHERE
key_id = 'a4365bc9bceec606fb79d18771d661d2294ebb18dd55f8bba22f9fc81d007cec'
AND (
token = 'M5NaHwu/pLM8oImVAd11dAVHBPQuPGLoGgukUru/tqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)