UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VTvEwVCaCykx5/qovsZQs00GEH3E8omNgpVhPHZyQII=' 
WHERE 
  key_id = '182939259c1f29b6e88181d8a60698ecf461bd2bd6bca7954929b17e38f84abf' 
  AND (
    token = 'VTvEwVCaCykx5/qovsZQs00GEH3E8omNgpVhPHZyQII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027