UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dBse+gDo3UbTmpMTLWWiTFgI1qMMTEBUpWf5ki1hHw='
WHERE
key_id = 'e7006e2b28a0b5b24f5ac5f96e067ecd5b80c2fe5ec63dd1d733e22fe275584b'
AND (
token = '3dBse+gDo3UbTmpMTLWWiTFgI1qMMTEBUpWf5ki1hHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)