UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oU731HwWdUH/nRDlVlSwEov4JfpYcN5yVaOnabKIFLM='
WHERE
key_id = '4a4c33b55a29200aa7825f15a75a8f84f021ed1a513429f53d580b32ae1f62c6'
AND (
token = 'oU731HwWdUH/nRDlVlSwEov4JfpYcN5yVaOnabKIFLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)