UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'klkr1lgXzxp3vLFXoquv6C8oDpwAuUn/GSeHKAE4uVA='
WHERE
key_id = 'e64f40efe7dbe35b0b6ebc7c0a1f28c72149fb57c3b3a9b2e29b378dd7e6eb39'
AND (
token = 'klkr1lgXzxp3vLFXoquv6C8oDpwAuUn/GSeHKAE4uVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)