UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yghLM9T4X/7bDf8hH1bQrFj6heQqsQYnBm8tU62zj50='
WHERE
key_id = '6eb262663b7c34d48647b87a09818129fe4c81d9919b32a8a6e5ca3aef4fe5cd'
AND (
token = 'yghLM9T4X/7bDf8hH1bQrFj6heQqsQYnBm8tU62zj50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)