UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a3nUpMAuTeUhiSBR5SisI/YnNSnUxtDSnqxavKzJhS0='
WHERE
key_id = 'bb3b82ec92f433e1cffc51de0f69b2b232a648a396da8a9d23df18fb44200a47'
AND (
token = 'a3nUpMAuTeUhiSBR5SisI/YnNSnUxtDSnqxavKzJhS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)