UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+HBbzGJxWncR5sAbWeskxevLJZZvFCixWo4YQqtlyW4=' 
WHERE 
  key_id = 'a85d59b2ddb721c0828a98d7a08b9cc19db826f4fe27c337d106bc70bff8ed74' 
  AND (
    token = '+HBbzGJxWncR5sAbWeskxevLJZZvFCixWo4YQqtlyW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027